# Contributor: Elly <elly@elly.town>
# Maintainer: Elly <elly@elly.town>
pkgname=spiped
pkgver=1.6.2
pkgrel=1
pkgdesc="Encrypted network pipe utility"
url="https://www.tarsnap.com/spiped.html"
# armhf and armv7 fail to build
arch="all !armhf !armv7"
license="BSD-2-Clause"
makedepends="openssl-dev"
source="https://www.tarsnap.com/spiped/spiped-$pkgver.tgz"
# Tests require a max 107 char directory
# This can not be guaranteed on every system building this package
# $tmpdir would work but is not compatible with rootbld
options="!check"

build() {
	make
}

check() {
	# choose a shorter path to workaround the
	# 107 char limit for unix domain sockets.
	# shellcheck disable=SC2154
	local testdir="$tmpdir/tests"

	# clear testdir to allow re-running of check().
	rm -rf "$testdir"
	mkdir -p "$testdir"

	# symlinking prevents rebuild of spiped.
	ln -s "$builddir"/* "$testdir"/
	make -C "$testdir" test
}

package() {
	make BINDIR="$pkgdir/usr/bin" install
}

sha512sums="
d16262a3e8be876ca1ef1aac8bb38fae91f523a9af0d488eb0dfa23e0b9db795d2a021e55f31095d92f5b94e4516e30ea23f537c3b14a2f1b9871297e26cda76  spiped-1.6.2.tgz
"
